<?php
class Adresse {
	protected $id_adresse;
	protected $referent;
	protected $code_postal;
	protected $ville;
	protected $pays;
	protected $adresse;
	
	public function __construct($id,$code,$ville,$pays,$adresse,$referent=null){
			$this->setId_adresse($id);
			$this->setCode_postal($code);
			$this->setVille($ville);
			$this->setPays($pays);
			$this->setAdresse($adresse);
			$this->setReferen($referent);
			
	}
	
	public function setId_adresse($id){
		$this->id_adresse = (int)$id;
	}
	public function getId_adresse(){
		return $this->id_adresse;	
	}
	
	public function setCode_postal($code){
		if(is_string($code) && strlen($code)==5)
			$this->code_postal = $code;	
	}
	
	public function getCode_postal(){
		return $this->code_postal;	
	}
	
	public function setVille($ville){
		if(is_string($ville))
			$this->ville = $ville;	
	}
	public function getVille(){
		return $this->ville;	
	}
	
	public function getPays(){
		return $this->pays	;
	}
	public function setPays($pays){
		if(is_string($pays))
			$this->pays = $pays;
	}
	
	public function getAdresse(){
		return $this->adresse;	
	}
	public function setAdresse($adresse){
			if(is_string($adresse))
				$this->adresse = $adresse;
	}
	public function getReferent(){
		return $this->referent;	
	}
	public function setReferen($ref){
		if(is_int($ref))
			$this->referent = $ref;	
	}
}